//package com.lw.common.config;
//
//import org.flowable.engine.ProcessEngineConfiguration;
//import org.flowable.spring.SpringProcessEngineConfiguration;
//import org.springframework.beans.factory.annotation.Qualifier;
//import org.springframework.boot.jdbc.DataSourceBuilder;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//
//import javax.sql.DataSource;
//
///**
// * 工作流单独设置数据源,否则会和shardingsphere多数据源冲突
// * by lw on 二〇二四年十二月四日 22:46:56
// */
//@Configuration
//public class FlowableConfig {
//
//    @Bean
//    public ProcessEngineConfiguration processEngineConfiguration( @Qualifier("flowableDataSource") DataSource dataSource) {
//        SpringProcessEngineConfiguration processEngineConfiguration = new SpringProcessEngineConfiguration();
//        processEngineConfiguration.setDataSource(dataSource);
//        processEngineConfiguration.setDatabaseSchemaUpdate("true");
//
//        return processEngineConfiguration;
//    }
//
//    @Bean
//    public DataSource flowableDataSource() {
//        // 创建独立的数据源实例
//        return DataSourceBuilder.create()
//                .url("jdbc:mysql://localhost:3306/springboot3mybatisflex?useUnicode=true&characterEncoding=utf-8&serverTimezone=UTC&useSSL=false&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true")
//                .username("root")
//                .password("123456")
//                .driverClassName("com.mysql.cj.jdbc.Driver")
//                .build();
//    }
//}
